# -*-* encoding:UTF-8 -*-
# author            : mengy
# date              : 2019/2/12
# python-version    : Python 3.7.0
# description       : 评论service

from com.articles.microapp.dao.remark_dao import RemarkDao
from com.articles.microapp.utils.constants import CommonConstants

consts = CommonConstants()


class RemarkService(object):
    __RemarkDao = RemarkDao()

    def get_remarks(self, article_id, user_id, page=[consts.DEFAULT_PAGE_NO, 20]):
        return self.__RemarkDao.get_remarks(article_id, user_id, page=page)

    def add_remark(self, article_id, user_id, content):
        return self.__RemarkDao.add_remark(article_id, user_id, content)

    def is_locked(self, id, user_id):
        return self.__RemarkDao.is_locked(id, user_id)

    def add_like(self, obj_id, user_id):
        return self.__RemarkDao.add_like(obj_id, user_id)

    def cancel_like(self, obj_id, user_id):
        return self.__RemarkDao.cancel_like(obj_id, user_id)
